<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>058-求和.html</title>
</head>
<body>
	
</body>
<script>
	// function sum(n1,n2,n3,n4){
	// 	console.log(arguments);
	// 	var result = 0;
	// 	result = n1 +n2 +n3 +n4;
	// 	alert(result);
	// }
	function sum(){
		// console.log(arguments);
		var result = 0;
		for(var i =0;i<arguments.length;i++){
			result = result + arguments[i];
		}
		alert(result);
	}
	sum(1,2,3,4,5,6);
</script>
</html>